using System;

using System.Linq;
using System.Text;
using System.Transactions;
using System.Collections.Generic;
using Entity;
using Common.Background.Entity;

namespace Common.Background.Data
{

    /// <summary>
    /// 
    /// </summary>
    public class WebManageMenusRepository : BackgroundRepositoryBase, IWebManageMenusRepository
    {

        #region IRepository<WebManageMenus> 成员

        public void Update(Entity.WebManageMenus entity)
        {
            base.UpdateEntity(entity);
        }

        public void Update(IList<Entity.WebManageMenus> list)
        {
            base.UpdateEntity(list.Cast<EntityBase>().ToList());
        }

        public void Insert(Entity.WebManageMenus entity)
        {
            base.InsertEntity(entity);
        }

        public void Insert(IList<Entity.WebManageMenus> list)
        {
            base.InsertEntity(list.Cast<EntityBase>().ToList());
        }

        public Entity.WebManageMenus InsertGetIDENTITY(Entity.WebManageMenus entity)
        {
            base.InsertEntity(entity);
            return this.Find(entity.MenuID);
        }

        public void Delete(Entity.WebManageMenus entity)
        {
            base.DeleteEntity(entity);
        }

        public void Delete(IList<Entity.WebManageMenus> list)
        {
            base.DeleteEntity(list.Cast<EntityBase>().ToList());
        }

        public IQueryable<Entity.WebManageMenus> GetModel()
        {
            return base.GetEntities<WebManageMenus>().Where(i => i.Status != (int)global::Entity.CommonEnums.Status.Deleted);
        }

        public Entity.WebManageMenus Find(params object[] keyValues)
        {
            return base.GetEntity<WebManageMenus>(keyValues);
        }

        #endregion
    }
}
